package me.lovetcat.common.base;

import org.springframework.beans.factory.annotation.Autowired;

/**
 * @author acat on 2017-01-12 16:56
 */
public class CrudService<P extends BasePo, D extends ICrudDao<P>> implements ICrudService<P> {

    @Autowired
    protected D d;

    @Override
    public int insert(P p) {
        return d.insert(p);
    }

    @Override
    public int delete(Integer id) {
        return d.delete(id);
    }

    @Override
    public int update(P p) {
        return d.update(p);
    }

    @Override
    public P get(Integer id) {
        return (P)d.get(id);
    }
}
